/*     */ package com.umeng.fb;
/*     */ 
/*     */ import android.app.NotificationManager;
/*     */ import android.app.PendingIntent;
/*     */ import android.content.Context;
/*     */ import android.content.Intent;
/*     */ import android.support.v4.app.NotificationCompat.Builder;
/*     */ import com.umeng.common.Log;
/*     */ import com.umeng.fb.b.b;
/*     */ import com.umeng.fb.b.e;
/*     */ import com.umeng.fb.model.Conversation;
/*     */ import com.umeng.fb.model.Store;
/*     */ import com.umeng.fb.model.UserInfo;
/*     */ import java.util.List;
/*     */ 
/*     */ public class FeedbackAgent
/*     */ {
/*  22 */   private static final String a = FeedbackAgent.class.getName();
/*     */   private Context b;
/*     */   private Store c;
/*     */ 
/*     */   public FeedbackAgent(Context paramContext)
/*     */   {
/*  29 */     this.b = paramContext;
/*  30 */     this.c = Store.getInstance(this.b);
/*     */   }
/*     */ 
/*     */   public List<String> getAllConversationIds() {
/*  34 */     return this.c.getAllConversationIds();
/*     */   }
/*     */ 
/*     */   public Conversation getConversationById(String paramString) {
/*  38 */     return this.c.getConversationById(paramString);
/*     */   }
/*     */ 
/*     */   public Conversation getDefaultConversation() {
/*  42 */     List localList = getAllConversationIds();
/*  43 */     if ((localList == null) || (localList.size() < 1)) {
/*  44 */       Log.c(a, 
/*  45 */         "getDefaultConversation: No conversation saved locally. Create a new one.");
/*  46 */       Conversation localConversation = new Conversation(this.b);
/*  47 */       return localConversation;
/*     */     }
/*  49 */     Log.c(a, "getDefaultConversation: There are " + localList.size() + 
/*  50 */       " saved locally, use the first one by default.");
/*  51 */     return getConversationById((String)localList.get(0));
/*     */   }
/*     */ 
/*     */   public void sync()
/*     */   {
/*  56 */     k localk = new k(this);
/*     */ 
/*  94 */     getDefaultConversation().sync(localk);
/*     */   }
/*     */ 
/*     */   private void a(String paramString)
/*     */   {
/* 104 */     NotificationManager localNotificationManager = (NotificationManager)this.b
/* 105 */       .getSystemService("notification");
/*     */ 
/* 107 */     String str = this.b.getString(
/* 108 */       e.b(this.b));
/*     */ 
/* 110 */     Intent localIntent = new Intent(this.b, ConversationActivity.class);
/* 111 */     localIntent.setFlags(131072);
/* 112 */     PendingIntent localPendingIntent = PendingIntent.getActivity(this.b, 0, 
/* 113 */       localIntent, 0);
/*     */ 
/* 115 */     NotificationCompat.Builder localBuilder = new NotificationCompat.Builder(
/* 116 */       this.b)
/* 117 */       .setSmallIcon(b.c(this.b))
/* 118 */       .setContentTitle(str).setTicker(str)
/* 119 */       .setContentText(paramString).setAutoCancel(true)
/* 120 */       .setContentIntent(localPendingIntent);
/*     */ 
/* 122 */     localNotificationManager.notify(0, localBuilder.build());
/*     */   }
/*     */ 
/*     */   public UserInfo getUserInfo() {
/* 126 */     return this.c.getUserInfo();
/*     */   }
/*     */ 
/*     */   public void setUserInfo(UserInfo paramUserInfo) {
/* 130 */     this.c.saveUserInfo(paramUserInfo);
/*     */   }
/*     */ 
/*     */   public long getUserInfoLastUpdateAt() {
/* 134 */     return this.c.getUserInfoLastUpdateAt();
/*     */   }
/*     */ 
/*     */   public void startFeedbackActivity() {
/*     */     try {
/* 139 */       Intent localIntent = new Intent();
/* 140 */       localIntent.setClass(this.b, ConversationActivity.class);
/* 141 */       this.b.startActivity(localIntent);
/*     */     } catch (Exception localException) {
/* 143 */       localException.printStackTrace();
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.fb.FeedbackAgent
 * JD-Core Version:    0.6.2
 */